package com.zqh.apicategoryquery.controller;

import com.zqh.apicategoryquery.service.ApiCategoryQueryService;
import com.zqh.myfmmall.result.Result;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Description :
 * @Author :kono淇杭哒、
 * @Create 2022-03-05 23:00
 */
@RestController
@RequestMapping("category/query")
public class ApiCategoryQueryController{
   @Resource
   private ApiCategoryQueryService apiCategoryQueryService;

    @GetMapping("retrieveByParentId/{parentId}")
    Result retrieveByParentId(@PathVariable("parentId") String parentId){
        return apiCategoryQueryService.retrieveVoByParentId(parentId);
    }

    @GetMapping("retrieveFirstLevalCategoryVos")
    Result retrieveFirstLevalCategoryVos(){
        return apiCategoryQueryService.retrieveFirstLevelCategoryVo();
    }

    @GetMapping("retrieveAllVos")
    Result retrieveAllVo(){
        return apiCategoryQueryService.retrieveAllCategorieVo();
    }
}
